﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace Isha.Web.Mvc
{
    public class ResourceDispatcherFactory
    {
        public ResourceDispatcherFactory()
        {

        }

        public static void ProcessRequest(HttpContextBase httpContext)
        {
            if (ResourceDispatcher.Extention == ".js" || ResourceDispatcher.Extention == ".css" || ResourceDispatcher.Extention == ".gif")
            {
                ResourceDispatcher resource = new ResourceDispatcher();
                httpContext.Response.Clear();
                httpContext.Response.ContentType = resource.ContentType;
                httpContext.Response.OutputStream.Write(resource.Bytes, 0, resource.Bytes.Length);
                httpContext.Response.End();
            }
        }
    }
}
